﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using DiscUtils.Iso9660;

namespace Elocin.CreateImage
{
    class Program
    {
        //compile bootloader arguments
        //nasm Nicole.asm -f bin -o Nicole.bin


        //path to compiled bootloader
        private static string bootPath = System.Reflection.Assembly.GetExecutingAssembly().Location.Replace("Elocin.CreateImage\\bin\\Debug\\Elocin.CreateImage.exe", "") + @"Boot\";
        private static string bootloader = bootPath + "Nicole.Bin";
        private static string bootloaderTagetName = "Nicole.bin";
        private static string iso = bootPath + "Elocin.iso";
        private static string volumeLabel = "VolumeName";

        static void Main(string[] args)
        {

            var builder = new CDBuilder { UseJoliet = true, VolumeIdentifier = volumeLabel };
            builder.AddFile(bootloaderTagetName, bootloader);
            builder.SetBootImage(new FileStream(bootloader, FileMode.Open, FileAccess.Read), BootDeviceEmulation.NoEmulation, 0);
            builder.Build(iso);
        }
    }
}
